Skip to content

Attachments: several files when creating an issue, 10 MiB per file (0.1.16) - #14

Merged
reoring merged 2 commits into
mainfrom
attach-on-create
Nov 12, 2026
Merged

reoring merged 2 commits into
mainfrom
attach-on-create

Conversation

@reoring

@reoring reoring commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

  • The New issue dialog had no way to attach anything: a person created the issue, opened it, then attached. Only the bug report page took screenshots up front.
  • 2 MiB per file refused full-page and high-density screenshots.

What

  • New issue dialog: choose several files, paste (also while typing the description) or drop; previews with remove; refused files (type, size, count) show their reason next to the area. On create the issue is made first, then files upload one by one with progress. If some uploads fail, the dialog stays in a result state naming the issue and the files not attached, with a link to the issue; there is no retry that could create a second issue.
  • Shared implementation: the report page and the dialog use one hook and one preview grid (web/src/features/issues/pending-attachments.tsx); pure parts in web/src/model/issues.ts.
  • Limit: 10 MiB per file (was 2 MiB), still 10 files per issue and the same media types. domain.AttachmentMaxBytes is the single server constant; migration 015 widens the column CHECK; the SPA constant and copy follow.

Trade-off

Attachments are bytea rows. At 10 MiB each upload and download is held in memory once, and an issue can hold 100 MiB. Recorded in design/README.md.

Verification

  • go vet ./cmd/...; go test -count=1 ./cmd/... against a disposable Postgres 17, including the new TestAttachmentSizeBoundary (exactly 10 MiB stored, one byte more refused) and the migration count.
  • web: tsc --noEmit, bun test src.
  • Browser against the mock API, 1280×800: Create visible with no files; 3 images selected → 3 previews; GIF and an 11 MiB PNG refused with reasons, a 6 MiB PNG accepted; one removed; image pasted into the description became an attachment with no text inserted; created issue showed the 4 attachments. Forced a 500 on the second upload → result state listed that file and linked the issue. /report still adds and refuses files.
  • Not verified: the deployed installation; the mobile bottom-sheet layout; a screen reader.

@reoring
reoring merged commit 80fe01c into main Nov 12, 2026
3 checks passed
@reoring
reoring deleted the attach-on-create branch November 12, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant